﻿@model MSAcademic.v2.Web.Models.AuthorViewModel

@{
    ViewBag.Title = Model.Author.FirstName + " " + Model.Author.LastName;
}

<div class="author">
    <div class="clearfix">
        <div class="picture"> <img src="@Model.Author.ProfilePictureUrl" /> </div>
        <div class="info">
            <h1>@(Model.Author.FirstName + " " + Model.Author.LastName)</h1>

            <hr />

            <div class="description"> @Html.Raw(Model.Author.Description)</div>

            <div class="social">
                <ul>
                    @if (!Model.Author.FacebookLink.IsEmpty()) { 
                        <li class="fb"><a href="@Model.Author.FacebookLink" target="_blank"> Pronađi me na Facebook-u</a></li>
                    }
                    @if (!Model.Author.TwitterLink.IsEmpty()) { 
                        <li class="tw"><a href="@Model.Author.TwitterLink" target="_blank"> Prati me na Twitteru-u</a></li>
                    }
                    @if (!Model.Author.LinkedInLink.IsEmpty()) { 
                        <li class="ln"><a href="@Model.Author.LinkedInLink" target="_blank"> Poveži se sa mnom na LinkedIn-u</a></li>
                    }
                    @if (!Model.Author.OtherLink.IsEmpty()) { 
                        <li><a href="@Model.Author.OtherLink" target="_blank"> @Model.Author.OtherLink </a></li>
                    }
                    @if (Model.Author.FacebookLink.IsEmpty() && Model.Author.LinkedInLink.IsEmpty() && Model.Author.TwitterLink.IsEmpty() && Model.Author.OtherLink.IsEmpty())
                    { 
                        <li class="empty-socials">Ne postoje informacije o prisustvu na društvenim mrežama (čovjek iz sjene) </li>
                    }

                </ul>
            </div>

            <hr />

            <div class="articles">
                <h2>
                    Posljednje vijesti ovog autora
                    <span class="number-of-articles">autor je napisao <b>@Model.AuthorsArticles.Count()</b> članaka</span>
                </h2>
                

                <div class="clearfix">
                @foreach (var article in Model.AuthorsArticles.Reverse().Take(12))
                {
                    <div class="item">
                        <div class="wrap">
                            <a href="@Url.RouteUrl("ArticleProfile", new { articleId = article.Id })">
                                <div class="article-picture"><img src="@article.PictureUrlNormal" /></div>
                                <h3>@article.Title</h3>
                            </a>
                        </div>
                    </div>
                }
                </div>
            </div>

        </div>
    </div>
</div>